﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Automation;
using Compiled_Tests.AutomationAbstractions;
using Tedds_Tool.Instructions;
using CommonInterfaces.Models;
using StandardScriptItems.SimpleControls;
using LEET.CommonInterfaces.Factories;
using LEET.CommonInterfaces.Automation;
using LEET.LEETCommon.AutomationAbstractions;
using LEET.CommonInterfaces.Models;
using LEET.LEETCommon.Model;
using System.Windows;

namespace ExpandCollapse
{
    public class ExpandCollapseModual : ILEETActionModual
    {
        public AutomationElementEventListener CreateListener(IObservableWidget elem, IRegistryAccessor reg)
        {
            return new ExpandCollapseEventListener(elem, reg);
        }

        public bool CanCompile(string instruction)
        {
            String [] parts = Instruction.ParseInstruction(instruction);
            return ("ACTION".Equals(parts[0].Trim()) && TypeName.Equals(parts[1].Trim()));
        }

        public IInstruction CreateInstruction(string instruction)
        {
            return new ExpndColpsInstruction(Instruction.ParseInstruction(instruction));
        }

        
        public void Initialize()
        {
        }

        public string TypeName
        {
            get { return "EXPNDCOLPS"; }
        }

        public FrameworkElement CreateScriptItemDetails(LEET.CommonInterfaces.Nil onUpdate, IEnumerable<string> processes, IElementState state)
        {
            ElementStateComboBox elem = new ElementStateComboBox(state);
            ScriptItemArgumentSelection arg1 = new ScriptItemArgumentSelection(elem, new String[] { "Expanded", "Collapsed" });
            return arg1;
        }


        
    }
}
